package com.springsummer.information.green.webmvc;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class NormalModelImpl extends ConcurrentHashMap<String, Object> implements Model {

    public NormalModelImpl() {
    }

    @Override
    public Model addAttribute(String attributeName, Object attributeValue) {
        put(attributeName, attributeValue);
        return this;
    }

    @Override
    public Model addAllAttributes(Map<String, ?> attributes) {
        putAll(attributes);
        return this;
    }

    @Override
    public boolean containsAttribute(String attributeName) {
        return containsKey(attributeName);
    }

    @Override
    public Object getAttribute(String attributeName) {
        return get(attributeName);
    }

}
